package com.da.javatest.thread.task;

import com.google.common.util.concurrent.ThreadFactoryBuilder;
import org.apache.commons.lang3.concurrent.BasicThreadFactory;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @description:
 * @author: yajun.dyj
 * @create: 2018-12-24 19:24
 **/
public class ThreadPoolUtils {

    public static ExecutorService executorService = new ThreadPoolExecutor(10, 10, 0L, TimeUnit.MILLISECONDS,
        new LinkedBlockingQueue<>(1024), new BasicThreadFactory.Builder().namingPattern(
        "upp-batch-creator-thread-pool-%d").daemon(true).build());

    public static ExecutorService es = new ThreadPoolExecutor(10, 10, 0L, TimeUnit.MILLISECONDS,
        new LinkedBlockingQueue<>(1024), new ThreadFactoryBuilder().setNameFormat("线程名称-%s").build());
}
